package com.clothing.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Service;

import com.clothing.entity.Message;
import com.clothing.service.MessageService;
import com.clothing.utils.page.Filter;
import com.clothing.utils.page.Filter.Operator;
import com.clothing.utils.page.Page;
import com.clothing.utils.page.Pageable;

/**
 * @ClassName: MessageServiceImpl 
 * @Description: TODO(Service) 
 * @author Charles.Tao 
 * @date 2017年9月6日 下午3:43:34 
 * @version 1.0
 */
@Service
public class MessageServiceImpl extends BaseServiceImpl<Message, Long> implements MessageService
{
    @Override
    public Page<Message> findMessage(Long userId, Pageable pageable)
    {
        List<Filter> filters = new ArrayList<Filter>();
        filters.add(new Filter("receiver.id", Operator.eq, userId));
        pageable.setFilters(filters);
        
        return findPage(pageable);
    }
}
